package com.lanou.service.impl;

import com.lanou.entity.CatTree;
import com.lanou.entity.TbItemCat;
import com.lanou.entity.TbItemCatExample;
import com.lanou.mapper.TbItemCatMapper;
import com.lanou.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by QuChao on 2018/11/9
 */
@Service
public class ItemCatServiceImpl implements ItemCatService {
    @Autowired
    private TbItemCatMapper itemCatMapper;

    @Override
    public List<TbItemCat> findCatByParentId(Integer id) {
        TbItemCatExample tbItemCatExample = new TbItemCatExample();
        tbItemCatExample.createCriteria().andParentIdEqualTo(id.longValue());
        List<TbItemCat> tbItemCats = itemCatMapper.selectByExample(tbItemCatExample);
        return tbItemCats;
    }
}
